<?php
/**
 * crontab commands
 * @文件名称: TestController.php
 * @author: jawei
 * @Email: gaozhiwei@etcp.cn
 * @Date: 2017-06-06
 * @Copyright: 2017 悦畅科技有限公司. All rights reserved.
 * 注意：本内容仅限于悦畅科技有限公司内部传阅，禁止外泄以及用于其他的商业目的
 */

namespace app\commands;

use app\base\BaseCommandController;
use app\components\DmpOss;

class TestController extends BaseCommandController
{
	public function actionTest()
	{
		$testfile = '/data/www/po/upload/test_oss_file';
		$object = DmpOss::getObjectNameByFileUrl($testfile);
		$instance = DmpOss::getInstance();
		$result = DmpOss::putObject($instance, $testfile, $object);
		var_dump('set', $result);

		$savePath = $testfile . '_get';
		$result = DmpOss::getObject($instance, $object, $savePath);
		var_dump('get: ',$result);
	}
}
